import React, { PureComponent } from 'react';
import { Drawer, Divider, Col, Row, Table, Card } from 'antd';
import * as selectOption from '../../../common/selectOption';
import { connect } from 'dva';

const pStyle = {
  width: '24px',
  height: '24px',
};

@connect(({ Account, loading }) => ({
  Account,
}))
class DrawerComponent extends PureComponent {
  constructor(props) {
    super(props);
  }

  render() {
    const { visible, onClose, Account } = this.props;
    const enterpriseColumns = [
      {
        title: '开户银行许可证',
        dataIndex: 'bankOpeningPermit',
        key: 'bankOpeningPermit',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '企业执照',
        dataIndex: 'businessLicense',
        key: 'businessLicense',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '组织机构代码',
        dataIndex: 'orgCode',
        key: 'orgCode',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '身份证正面',
        dataIndex: 'cardFacade',
        key: 'cardFacade',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '税务证',
        dataIndex: 'taxRegistration',
        key: 'taxRegistration',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '三证合一',
        dataIndex: 'threeCardsTogether',
        key: 'threeCardsTogether',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '身份证反面',
        dataIndex: 'cardBack',
        key: 'cardBack',
        render: text => (
          <a href={text}>
            <img style={pStyle} src={text} alt="" />
          </a>
        ),
      },
      {
        title: '上传人',
        dataIndex: 'createName',
        key: 'createName',
      },
    ];
    return (
      <Drawer
        width={900}
        placement="right"
        closable={true}
        onClose={() => onClose(false, [])}
        visible={visible}
      >
        <Table
          pagination={false}
          dataSource={Account.AccountDataList || []}
          columns={enterpriseColumns}
        />
      </Drawer>
    );
  }
}

export default DrawerComponent;
